using System;
using System.Web.Mvc;
using Azure.Domain.Models;
using Azure.Domain.Services;
using Azure.Web.Controllers;
using Azure.Web.Models;
using Rhino.Mocks;
using Xunit;

namespace Azure.Tests.Web.Controllers
{
    public class BaseControllerFacts : ControllerFacts<BaseControllerFacts.TestableController>
    {
        [Fact]
        public void ViewWillSetTheSiteConfiguraiton()
        {
            Mock<IBlogConfiguration>().Stub(x => x.Configuration).Return(new SiteConfiguration());
            var view = (ViewResult) ClassUnderTest.ExposedView();

            Assert.NotNull(view);
            Assert.NotNull(view.ViewData[Data.Site]);
        }

        public class TestableController : BaseController
        {
            public TestableController(IBlogConfiguration configuration) : base(configuration){ }

            public ActionResult ExposedView()
            {
                return View();
            }
        }
    }
}